<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}黄淮学院教务系统{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .navbar-brand {
            font-weight: bold;
        }
        .card {
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }
        .table th {
            background-color: #e9ecef;
        }
        .course-cell {
            min-height: 60px;
            vertical-align: middle;
            font-size: 12px;
            padding: 5px;
        }
        .course-content {
            background-color: #e3f2fd;
            border-radius: 4px;
            padding: 3px;
            margin: 1px;
            word-break: break-all;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="{% url 'course_schedule' %}">黄淮学院教务系统</a>
            {% if request.session.logged_in %}
            <div class="navbar-nav ms-auto">
                <span class="navbar-text me-3">欢迎，{{ request.session.username }}</span>
                <a class="nav-link" href="{% url 'course_schedule' %}">课程表</a>
                <a class="nav-link" href="{% url 'grades' %}">成绩查询</a>
                <div class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="apiMenu" role="button" data-bs-toggle="dropdown" aria-expanded="false">API合集</a>
                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="apiMenu">
                        <li><a class="dropdown-item" href="{% url 'bilibili_extract_page' %}">B站视频提取</a></li>
                        <li><a class="dropdown-item" href="{% url 'bilibili_summarize_page' %}">B站视频总结</a></li>
                    </ul>
                </div>
                <a class="nav-link" href="{% url 'logout' %}">退出</a>
            </div>
            {% endif %}
        </div>
    </nav>

    <div class="container mt-4">
        {% if messages %}
            {% for message in messages %}
                <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                    {{ message }}
                    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                </div>
            {% endfor %}
        {% endif %}

        {% block content %}
        {% endblock %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
